package com.xiaobao.controller;


import com.xiaobao.pojo.Result;
import com.xiaobao.pojo.School;
import com.xiaobao.service.SchoolService;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

//学校信息
@RestController
public class SchoolController {
    private final SchoolService schoolService;

    public SchoolController(SchoolService schoolService) {
        this.schoolService = schoolService;
    }

    //查询所有考研学校
    @GetMapping("/getAllSchool")
    public Result<School[]> getAllSchools(){
        return new Result<>(HttpStatus.OK, schoolService.getAllSchools(), "查询成功");
    }
}
